function adminlogin(){
    var email=document.getElementById("email").value;
    var password=document.getElementById("password").value;
    var params = "email="+email+"&password="+password;
    var url = "include/adminclass/login.class.php";
        $.ajax({
            type: 'POST',
            url: url,
            dataType: 'html',
            data: params,
            beforeSend: function() {
                document.getElementById("status").innerHTML= '<font style="color:green;">Überprüfe Daten...</font>';
            },
            complete: function() {
            },
            success: function(html) {
                document.getElementById("status").innerHTML= html;
                    if(html=="Erfolgreich"){
                        window.location = "admin.php"
                }
            }
    });
}

function adminlogout(){
    var params = "logout=true";
    var url = "include/adminclass/logout.class.php";
        $.ajax({
            type: 'POST',
            url: url,
            dataType: 'html',
            data: params,
            beforeSend: function() {
                document.getElementById("logoutstatus").innerHTML= '<font style="color:green;">...</font>';
            },
            complete: function() {
            },
            success: function(html) {
                document.getElementById("logoutstatus").innerHTML= html;
                    if(html=="Erfolgreich"){
                        window.location = "admin.php";
                        document.getElementById("logoutstatus").innerHTML= '<font style="color:green;">Ausgeloggt...</font>';
                }
            }
    });
}
